<template>
	<view>
		<logistics :wlInfo="wlInfo"></logistics>
	</view>
</template>

<script>
	import logistics from '@/components/xinyu-logistics/xinyu-logistics.vue'
	export default {
		components: { logistics },
		data() {
			return {
				wlInfo: {
					delivery_status: 1, //快递状态 0在途，1揽收，2疑难，3签收，4退签，5派件，8清关，14拒签
					post_name: '韵达快递', //快递名称
					logo: '', //快递logo
					exp_phone: '95546', //快递电话
					post_no: '4304678557725', //快递单号
					addr: '江西省南昌市青云谱区', //收货地址
					//物流信息
					list: []
				},
				order_id:""
			};
		},
		onLoad(ops){
			this.order_id=ops.order_id
			this.queryLogistics();
		},
		methods:{
			// 物流信息
			queryLogistics(){
				this.$request.post(this.$api.queryLogistics, {
					order_id:this.order_id
				}, {
					token:true
				}).then(res => {
					if (res.code == 1) {
						let {
							data = {}
						} = res;
						for(let i in data.data){
							data.data[i].timeArr=data.data[i].time.split(' ');
						}
						this.wlInfo={
							post_no:data.nu,
							post_name:data.order.expressname,
							addr:data.order.address,
							exp_phone:data.order.tel,
							logo:data.order.logo,
							delivery_status:data.state,
							list:data.data
						}
						console.log(this.wlInfo)
					}
				})
			},
		}
	}
</script>

<style lang="scss">

</style>
